const nodata = require('../tw-lib-base/no-data/props')
const commonProps = require('../tw-lib-base/chart/common-props')
const axisProps = require('../tw-lib-base/chart/axis-props')
const datazoomProps = require('../tw-lib-base/chart/datazoom-props')
const tooltipProps = require('../tw-lib-base/chart/tooltip-props')

module.exports = {
  ...commonProps,

  ...axisProps,
  ...datazoomProps,
  ...tooltipProps,

  data: {
    type: Array,
    default () {
      return [
        ['姓名', '徽章数量', '奖励徽章', '批评徽章'],
        ['2020-06-05', 0.5, 1.5, 1.5],
        ['2020-06-12', 1.1, 1.4, 2.55],
        ['2020-06-19', 0.4, 2.2, 2.5],
        ['2020-06-25', 4.4, 1.80, 8.5]
      ]
    },
    name: '图表数据集',
    filedType: 'api'
  },
  dataLength: {
    type: String,
    default: '1',
    name: '显示数组长度',
    filedType: 'string'
  },
  isSmooth: {
    type: Boolean,
    default: false,
    name: '是否平滑显示',
    filedType: 'switch'
  },

  useTooltipFun: {
    type: Boolean,
    default: true,
    name: '启用tooltip函数',
    filedType: 'switch'
  },
  tooltipLabel: {
    type: String,
    default: '',
    name: 'tooltip内容格式器',
    filedType: 'string'
  },
  funcTooltip: {
    type: Function,
    default: 'function tmptooltipfunc (params) {if (params instanceof Array) {let toolvalue = params[0].name;let pcanshu=["枚","枚","枚"]; for (let i =1;i<=params[0].dimensionNames.length - 1;i++) {toolvalue += "<br />" + params[0].marker + params[0].dimensionNames[i] + ": " + params[0].value[i]+ pcanshu[i - 1]} return toolvalue}}',
    name: 'tooltip触发函数',
    filedType: 'function'
  },

  ...nodata
}
